/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CORE_H
#define __CORE_H

#define PI 3.141592654f

#define RATE_1_HZ		1
#define RATE_5_HZ		5
#define RATE_8_HZ		8
#define RATE_10_HZ		10
#define RATE_25_HZ		25
#define RATE_50_HZ		50
#define RATE_100_HZ		100
#define RATE_200_HZ 	200
#define RATE_250_HZ 	250
#define RATE_500_HZ 	500
#define RATE_1000_HZ 	1000

#define MAIN_LOOP_RATE 	RATE_1000_HZ
#define RATE_DO_EXECUTE(RATE_HZ, TICK) ((TICK % (MAIN_LOOP_RATE / RATE_HZ)) == 0)

#define ABSOLUTE(x) ((x)>0? (x):(-(x)))

#define MIN(a,b) 				(((a)<(b))?(a):(b))
#define MAX(a,b) 				(((a)>(b))?(a):(b))
#define CLAMP(x, lower, upper) 	(MIN(upper, MAX(x, lower))) //限幅

typedef union 
{
	struct 
	{
		float x;
		float y;
		float z;
	};
	float axis[3];
} Axis3f;

typedef union 
{
	struct 
	{  
		float x;
		float y;
	};
	float axis[2];
} Axis2f;

typedef enum{
	True = 1,
	False = 0,	
}Bool;

typedef void fun_t(void);

#include "incl.h"

void imuTransformVectorBodyToEarth(Axis3f * v, float angle);
void pressureFilter(float* in, float* out);
#endif /* __CORE_H */

/******************* (H) COPYRIGHT 2023 FUYEBING*****END OF FILE************/

